package com.syh.jn.scm.infrastructure.repository.model.finance;

import com.syh.core.ddd.infrastructure.repository.model.SuperBusinessModel;
import lombok.*;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * 发票
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Entity
@Table(name = "T_FINANCE_INVOICE")
@EqualsAndHashCode(callSuper = true)
public class InvoiceModel extends SuperBusinessModel {
  /**
   * 发票类型:-1进项发票,1销项发票
   */
  @Column(name = "INVOICE_TYPE", columnDefinition = "smallint COMMENT '发票类型:-1进项发票,1销项发票'")
  private Short invoiceType;
  /**
   * 对账单id
   */
  @Column(name = "STATEMENT_OF_ACCOUNT_ID", columnDefinition = "bigint COMMENT '对账单id'")
  private Long statementOfAccountId;
  /**
   * 签收商家
   */
  @Column(name = "SIGN_FOR_COMPANY_ID", columnDefinition = "bigint COMMENT '签收商家'")
  private Long signForCompanyId;
  /**
   * 录单人id
   */
  @Column(name = "BROKERAGE_ID", columnDefinition = "bigint COMMENT '录单人id'")
  private Long brokerageId;
  /**
   * 开票总额
   */
  @Column(name = "PRICE", columnDefinition = "decimal(19,2) COMMENT '开票总额'")
  private BigDecimal price;
  /**
   * 发票数量
   */
  @Column(name = "INVOICE_COUNT", columnDefinition = "int COMMENT '发票数量'")
  private Long invoiceCount;
  /**
   * 快递单编号
   */
  @Column(name = "EXPRESS_LIST_CODE", columnDefinition = "varchar(50) COMMENT '快递单编号'")
  private String expressListCode;
  /**
   * 物流公司
   */
  @Column(name = "EXPRESS_COMPANY", columnDefinition = "varchar(50) COMMENT '物流公司'")
  private String expressCompany;
  /**
   * 签收日期
   */
  @Column(name="BILLING_TIMESTAMP" , columnDefinition=("bigint COMMENT '签收日期'"))
  private Long billingTimestamp;
  /**
   * 收票日期
   */
  @Column(name="SIGNING_TIMESTAMP" , columnDefinition=("bigint COMMENT '收票日期'"))
  private Long signingTimestamp;
  /**
   * 开票记录状态:-1取消签收, 0未签收, 1已签收
   */
  @Column(name = "STATE", columnDefinition = "smallint COMMENT '发票状态: 0未签收, 1已签收'")
  private Short state;
  /**
   * 锁定状态(0 未锁定 1 已锁定 )签收后就锁定它，锁定后为最终状态，将不可再修改
   */
  @Column(name = "LOCK_STATUS", columnDefinition = "smallint COMMENT '锁定状态(0 未锁定 1 已锁定 )'")
  private Short lockStatus;
  /**
   * 我方发票基本信息:公司名称
   */
  @Column(name = "OUR_INVOICE_COMPANY_NAME", columnDefinition = "varchar(300) COMMENT '我方发票基本信息:公司名称'")
  private String ourInvoiceCompanyName;
  /**
   * 我方发票基本信息:收款银行名称
   */
  @Column(name = "OUR_INVOICE_BANK_NAME", columnDefinition = "varchar(300) COMMENT '我方发票基本信息:收款银行名称'")
  private String ourInvoiceBankName;
  /**
   * 我方发票基本信息:收款银行账户
   */
  @Column(name = "OUR_INVOICE_BANK_ACCOUNT", columnDefinition = "varchar(300) COMMENT '我方发票基本信息:收款银行账户'")
  private String ourInvoiceBankAccount;
  /**
   * 我方发票基本信息:纳税人识别号
   */
  @Column(name = "OUR_INVOICE_TAXPAYER_CODE", columnDefinition = "varchar(300) COMMENT '我方发票基本信息:纳税人识别号'")
  private String ourInvoiceTaxpayerCode;
  /**
   * 上游或下游发票基本信息:公司名称
   */
  @Column(name = "OTHER_PARTY_INVOICE_COMPANY_NAME", columnDefinition = "varchar(300) COMMENT '上游或下游发票基本信息:公司名称'")
  private String otherPartyInvoiceCompanyName;
  /**
   * 上游或下游发票基本信息:收款银行名称
   */
  @Column(name = "OTHER_PARTY_INVOICE_BANK_NAME", columnDefinition = "varchar(300) COMMENT '上游或下游发票基本信息:收款银行名称'")
  private String otherPartyInvoiceBankName;
  /**
   * 上游或下游发票基本信息:收款银行账户
   */
  @Column(name = "OTHER_PARTY_INVOICE_BANK_ACCOUNT", columnDefinition = "varchar(300) COMMENT '上游或下游发票基本信息:收款银行账户'")
  private String otherPartyInvoiceBankAccount;
  /**
   * 上游或下游发票基本信息:纳税人识别号
   */
  @Column(name = "OTHER_PARTY_INVOICE_TAXPAYER_CODE", columnDefinition = "varchar(300) COMMENT '上游或下游发票基本信息:纳税人识别号'")
  private String otherPartyInvoiceTaxpayerCode;
  /**
   * 创建日期
   */
  @Column(name = "CREATE_TIME_STAMP", columnDefinition = "bigint COMMENT '创建日期'")
  private Long createTimeStamp;
  /**
   * 最后修改日期
   */
  @Column(name = "LAST_UPDATE_TIME_STAMP", columnDefinition = "bigint COMMENT '最后修改日期'")
  private Long lastUpdateTimeStamp;
}
